home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 4671-5.790 / dmg-4961 / power / stoshelp.pwr < prev    next >
Text File  |  1989-12-31  |  14KB  |  403 lines

  1.  
  2. ----------------------------------------------------------------------------
  3.                                    T H E
  4.  
  5.                 <<<<<>>>>> <<<<<>>>>> <<<<<>>>>> <<<<<>>>>>
  6.                 <<<<<         <<>>    <<<    >>> <<<<<
  7.                 <<<<<>>>>>    <<>>    <<<    >>> <<<<<>>>>>
  8.                      >>>>>    <<>>    <<<    >>>      >>>>>
  9.                 <<<<<>>>>>    <<>>    <<<<<>>>>> <<<<<>>>>>
  10.  
  11.  
  12.                          A D V I C E   B U R E A U
  13. ----------------------------------------------------------------------------
  14.                    YOUR STOS-RELATED PROBLEMS ANSWERED BY
  15.                       CHRIS SHARP OF SUPREME SOFTWARE
  16.                                     AND
  17.                           DEANO OF SILLY SOFTWARE
  18. ----------------------------------------------------------------------------
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. Due to a corrupt disk (thanks Mr.  ROYAL MAIL!) we are unable to print Chris 
  32. Sharp's  answers  to this months STOS problems but he IS still on  the  team 
  33. ready  to  answer your questions so if you have a STOS query and  you  would 
  34. like  to  send  it  to Chris Sharp of SUPREME SOFTWARE  then  write  to  the 
  35. following address:
  36.  
  37.  
  38.                                 CHRIS SHARP
  39.                               SUPREME SOFTWARE
  40.                              4 SUNNYCROFT LANE
  41.                                 DINAS POWYS
  42.                               SOUTH GLAMORGAN
  43.                                 SOUTH WALES
  44.                                   CF64 4QQ
  45.  
  46.  
  47. Or write to Deano of SILLY SOFTWARE at this address:
  48.  
  49.  
  50.                                    DEANO
  51.                                SILLY SOFTWARE
  52.                               27 TURBARY WALK
  53.                                   MILNROW
  54.                                   ROCHDALE
  55.                                   OL16 4JN
  56.  
  57.  
  58. Or if the worst comes to the worst you can send your STOS problems to me  at 
  59. the normal POWER address.   Either way, your question(s) will be answered by 
  60. both Chris and Deano.  Okay, here are this months questions...
  61.  
  62.  
  63. ****************************************************************************
  64.  
  65.  
  66. Dear POWER,
  67.           I  have  a  520  STE upgraded to 1  meg  and  the  following  STOS 
  68. extensions:
  69.  
  70.                                   BLITTER
  71.                                     STE
  72.                                    MISTY
  73.                                    QUICK 
  74.                                   CONTROL 
  75.                                   TRACKER
  76.  
  77. 1.  I  am  currently trying to code a RPG (captive style) but  I  am  having 
  78. trouble.  Please could you tell me the fastest way to do the following:
  79.  
  80. - Read the maze position and walls, door and baddies.
  81. - Update position and bung it on the screen.
  82.  
  83.  
  84. 2.  Is it possible to poke scores or graphics into the overscan area and  if 
  85. so, how?
  86.  
  87.  
  88. 3. With a game like Space Invaders and Galaxians, what would be the best way 
  89. to check collisions?
  90.  
  91.  
  92. 4. How the hell do I get hold of the EXTRA Extension?
  93.  
  94.  
  95. 5.  A  friend  of mine (the only other person in Thetford with  a  ST)  just 
  96. bought  the  STOS  compiler  from  a  car  bootsale  and  it  doesn't   have 
  97. instructions  (no it's not a copy,  I can prove it!) and I can't figure  out 
  98. the following things:
  99.  
  100. - I  can compile to basic and save it as a .CMP file how do you execute it? 
  101. -  When  compiling to GEM how do you load external  datafiles  (i.e.  MBK's) 
  102. without it automatically adding them to the compiled .PRG?
  103.  
  104.  
  105. 6. In Pacman-type games, how do you give the ghosts intelligence to roam the 
  106. maze on their own?
  107.  
  108.  
  109. 7.  What  is your opinion of the 3D extension as I have been thinking  about 
  110. getting it but I don't know how good it is?
  111.  
  112.  
  113. 8. When I registered the Misty Extension the registration disk had a routine 
  114. to  display fullscreen pictures, I have corrupted my registration  disk  and 
  115. didn't make a backup, so could you please tell me how to do it?
  116.  
  117.  
  118. Cheers.
  119.  
  120.  
  121. From Lee Ashmore
  122.  
  123.  
  124. DEANO OF SILLY SOFTWARE REPLIES:
  125.  
  126. Answer One...
  127.  
  128. The quickest way of reading things like exits and such in a maze of rooms is 
  129. to store all the info in arrays, then check which room the player is in and 
  130. set zones in that room. For example, the following routine shows us how to 
  131. set up zones in each room and set them up when the player enters it. 
  132.  
  133. 10 key off : curs off : mode 0
  134. 20 dim MAP(5,4) : dim XZ1(5,4),YZ1(5,4),XZ2(5,4),YZ2(5,4) : ROOM=1
  135. 25 rem SET UP MAP EXIT VALUES
  136. 30 for X=1 to 5 : for Y=1 to 4
  137. 40 read MAP(X,Y)
  138. 50 next Y : next X
  139. 52 rem SET UP ZONE CO-ORDINATES FOR EACH ROOM
  140. 55 for X=1 to 5 : for Y=1 to 4
  141. 66 read A,B,C,D
  142. 70 XZ1(X,Y)=A : YZ1(X,Y)=B : XZ2(X,Y)=C : YZ2(X,Y)=D
  143. 75 next Y : next X
  144. 76 rem DRAW EXIT BOXES AND INFO OF WHERE EACH ONE GOES
  145. 80 home : print "ROOM";ROOM : locate 0,6
  146. 90 for X=1 to 4
  147. 100 box XZ1(ROOM,X),YZ1(ROOM,X) to XZ2(ROOM,X),YZ2(ROOM,X)
  148. 110 set zone X,XZ1(ROOM,X),YZ1(ROOM,X) to XZ2(ROOM,X),YZ2(ROOM,X)
  149. 115 print "EXIT";X;" GOES TO ROOM";MAP(ROOM,X)
  150. 120 next X
  151. 125 rem WAIT FOR PLAYER TO CHOOSE A ZONE
  152. 130 repeat 
  153. 140 EXIT=zone(0)
  154. 150 until EXIT<>0 and mouse key=1
  155. 155 rem SET ROOM VALUE TO NEW ROOM
  156. 160 ROOM=MAP(ROOM,EXIT) : goto 80
  157. 1000 rem EXIT VALUES FOR EACH OF THE FIVE ROOMS IN MAZE
  158. 1010 data 2,3,4,5
  159. 1020 data 1,2,3,4
  160. 1030 data 2,1,3,4
  161. 1040 data 3,2,1,5
  162. 1050 data 1,2,3,4
  163. 2000 rem ZONE CO-ORDINATES FOR ROOM ONE
  164. 2010 data 10,20,20,40
  165. 2020 data 30,20,40,40
  166. 2030 data 50,20,60,40
  167. 2040 data 70,20,80,40
  168. 2060 rem ZONE CO-ORDINATES FOR ROOM TWO
  169. 2070 data 10,20,20,40
  170. 2080 data 30,20,40,40
  171. 2090 data 50,20,60,40
  172. 2100 data 70,20,80,40
  173. 2120 rem ZONE CO-ORDINATES FOR ROOM THREE
  174. 2130 data 10,20,20,40
  175. 2140 data 30,20,40,40
  176. 2150 data 50,20,60,40
  177. 2160 data 70,20,80,40
  178. 2170 rem ZONE CO-ORDINATES FOR ROOM FOUR
  179. 2180 data 10,20,20,40
  180. 2190 data 30,20,40,40
  181. 2200 data 50,20,60,40
  182. 2210 data 70,20,80,40
  183. 2220 rem ZONE CO-ORDINATES FOR ROOM FIVE
  184. 2230 data 10,20,20,40
  185. 2240 data 30,20,40,40
  186. 2250 data 50,20,60,40
  187. 2260 data 70,20,80,40
  188.  
  189. In this routine we have five rooms in the maze, each with four exits which 
  190. all lead to other parts of the maze.  The MAP  array  works  like this, the 
  191. varible ROOM holds the number of the players position in the maze, in other 
  192. words the room number. The first set of data statements allow us to specify 
  193. which exit leads to which room. For example....
  194.  
  195. 10 read MAP(1,1),MAP(1,2),MAP(1,3),MAP(1,4)
  196. 20 data 2,3,4,5
  197.  
  198. This means that exit one leads to room two, exit two leads to room three and 
  199. so on. When you run this routine you will see four boxes on screen, 
  200. representing four zones, or exits in this case. Clicking the left mouse key 
  201. in a zone will set the varible ROOM to the new destination room. With this 
  202. method you can easily tell where you are by just reading the ROOM varible. 
  203. With this you can then call up the part of the maze you want.
  204.  
  205. 100 screen$(logic,16,0)=R$(ROOM)
  206.  
  207. The arrays XZ1, YZ1, XZ2, and YZ2 hold the co-ordinates of the exit boxes on 
  208. screen. The format goes.....
  209.  
  210. XZ1(ROOM,EXIT)
  211.  
  212. So we can set up four zones in the present room using the SET ZONE command 
  213. then check which zone the player chooses. The exit zones could be four 
  214. arrows pointing in four directions. Using this method you can check whats on 
  215. screen in this method. For example, if the player clicked on a baddie in 
  216. order to fight him, then you could say that the baddie is in room three and 
  217. is in zone two, and check like this.
  218.  
  219. 10 repeat
  220. 20 CH=zone(0) : wait vbl
  221. 30 until CH<>0 and mouse key=1
  222. 40 if ROOM=3 and CH=2 then gosub 1000
  223.  
  224. Where line 1000 onwards holds the routine for fighting the baddie.
  225.  
  226. Answer Two....
  227.  
  228. I've never used any overscanning methods so I can't help you there. Maybe 
  229. Chris has the answer.....he's very clever you know.
  230.  
  231. Answer Three....
  232.  
  233. The best and fastest way of checking colisions would proberly be to use the 
  234. missing link MANY BOB and MANY OVERLAP commands. This allows you to have a 
  235. fair few bobs (preshifted sprites) flying around with fast checking.
  236.  
  237. Answer Four....
  238.  
  239. The EXTRA extension can be obtained by sending a disk of P.D. and return 
  240. postage to the author himself.
  241.  
  242. Martin Cubbit
  243. 14 Deepdene Avenue
  244. Rayleigh
  245. Essex
  246. SS6 9LG
  247.  
  248. Its currently at version 2.10.
  249.  
  250. Answer Five....
  251.  
  252. A CMP file saved by the compiler can be treated the same as a BAS file. Just 
  253. load and run it as you would a BAS file. The only difference is that you 
  254. can't see the basic listing in a CMP file.
  255.  
  256. Errm, ho hum, well the compiler only loads the files it needs. If you don't 
  257. use sprites then it will ignore the SPRITE.BIN file, only adding the machine 
  258. code routines it needs to run sprites, windows, and so on. If you wanted to 
  259. load other files when the program is running from GEM then you just use the 
  260. LOAD command in the normal way. For example...
  261.  
  262. 100 load"picture.mbk",5
  263.  
  264. If you don't want to keep this file in memory then you can simply erase the 
  265. bank with the ERASE command.
  266.  
  267. Answer Six....
  268.  
  269. It depends on what your using, either sprites or ML bobs. The thing I would 
  270. suggest (and hope it works), is to define your ghost sprite and place the 
  271. hot spot in the top left hand corner. Lets look at the sprite method.
  272.  
  273. Draw your maze using the MAP accessory and make note of the colour of the 
  274. background that the ghost moves over. This of course would be colour nought. 
  275. We can use a routine that tells the sprite to only move along that colour.
  276.  
  277. 10 key off : hide on : flash off : curs off : mode 0
  278. 20 ROOM=1 : gosub 5000 : rem DRAW ROOM ONE OF THE MAP
  279. 30 sprite 1,40,72,1 : rem SPRITE STARTING POSITION
  280. 40 if movon(1)=0 then gosub 1000
  281. 50 gosub 2000
  282. 60 goto 40
  283. 1000 rem MOVE SPRITE IN CERTAIN DIRECTION
  284. 1010 if D=1 then move X 1,"(2,-1,1)"
  285. 1020 if D=2 then move X 1,"(2,1,1)"
  286. 1030 if D=3 then move Y 1,"(2,-1,1)"
  287. 1040 if D=4 then move Y 1,"(2,1,1)"
  288. 1050 move on 1 : return
  289. 2000 rem CHECK IF SPRITE AT DEAD END, IF SO, MOVE IT ANOTHER WAY
  290. 2010 X=xsprite(1) : y=ysprite(1) : S1=point(X,Y+8) : S2=point(X+16,Y+8) :  
  291.      S3=point(X+8,Y) : S4=point(X+8,Y+8) 
  292. 2020 if S1<>0 and D=1 then D=2 
  293. 2030 if S2<>0 and D=2 then D=1
  294. 2040 if S3<>0 and D=3 then D=4
  295. 2050 if S4<>0 and D=4 then D=3 
  296. 2060 return
  297.  
  298. As this routine has just come from a few guesses, I'm not sure if it will 
  299. actually work properly. However, with a bit of messing about it should be 
  300. okay. The routine works by checking the colour in front of the sprite, if 
  301. its different from the background colour then we use the varible D to change 
  302. direction. Unlike the DETECT command the POINT command allows us to check 
  303. any part of the sprite, so we can check all sides. I think Chris would 
  304. proberly give a better working routine of this anyway as I've just not add 
  305. time to work such a routine out.
  306.  
  307. Answer Seven....
  308.  
  309. STOS 3D is a pretty powerful package, but its down side is speed. Its also 
  310. not very easy to use. But I think its worth a try if you want to make your 
  311. own STOS 3D games.
  312.  
  313. Answer Eight....
  314.  
  315. I have sent you the MISTY registration disk to replace the copy you lost. 
  316. You'll have to get the routine from that as this kind of routine is beyond 
  317. me. Might you, I'll get there one day.
  318.  
  319.  
  320. ****************************************************************************
  321.  
  322.  
  323. Dear POWER,
  324.           I have recently found out how limiting 15 banks in STOS can be but 
  325. I've  heard of a method called 'stacking' which apparently lets you have  as 
  326. many  banks as you want in theory.   How do I stack a bank and is there  any 
  327. kind of limit or rules that have to be followed?
  328.  
  329.  
  330. From Neil Simons
  331.  
  332.  
  333. DEANO OF SILLY SOFTWARE REPLIES:
  334.  
  335. Think of a large box, this allows us to put more than one item in it. Its 
  336. the same with banks, we can actually set the size of it then load the files 
  337. into it one after another. This method with stack PAC pictures.
  338.  
  339. First make a note of the length of each PAC file then add them all together, 
  340. then add about twenty bytes and make it an even number. You then choose a 
  341. bank and reserve it to this size.
  342.  
  343. 10 reserve as data 5,80000
  344.  
  345. Note reserving a work bank makes it a tempory bank while reserving a data 
  346. bank means it can be saved along with your program.
  347.  
  348. Load the first file in like this.
  349.  
  350. 20 load"pic1.pac",start(5)
  351.  
  352. Now the next thing to do is load the next picture into the position where 
  353. the last picture ends. So, get the length of the first file and make it into 
  354. an even number. For example, if the file is 1787 bytes long then call it 
  355. 1790 bytes long. We can now load the second file in, in front of the first 
  356. file just like this.
  357.  
  358. 30 load"pic2.pac",start(5)+1790
  359.  
  360. After this we just take the length of the pictures already loaded and load 
  361. the next picture in. For example, lets say our pictures are like this.
  362.  
  363. PIC1.PAC    LENGTH 1787   ROUNDED TO EVEN 1790
  364. PIC2.PAC    LENGTH 2136   ROUNDED TO EVEN 2140
  365.  
  366. We take these two values and add them together, which makes 3930. If the 
  367. value is an odd number then you must make it even. We can then load this 
  368. file in. 
  369.  
  370. 30 load "pic3.pac",start(5)+3930
  371.  
  372. Do the same with the other files already loaded, add them together and round 
  373. them up to even numbers to find where to load the next picture in.
  374.  
  375. To get at them, all you have to do is this.
  376.  
  377. 40 unpack 5 : rem unpack the first picture
  378. 50 unpack start(5)+3930 : rem unpack picture three
  379.  
  380. There is an easier method if you have the missing link extension. This has 
  381. two commands called BANK LOAD and BANK COPY. Use the MAKEBANK program on the 
  382. source disk to load all files and save them as an FBANK with the extension 
  383. BNK. You can then load and use them like this.
  384.  
  385. 10 mode 0 : key off : flash off : curs off
  386. 20 PICNO=1
  387. 30 reserve as work 5,80000
  388. 40 bload"pics.bnk",5
  389. 50 reserve as work 6,9000
  390. 60 bank copy start(5),start(6),PICNO
  391. 70 unpack 6
  392.  
  393. This copies the specified picture from the stacked bank into bank six and 
  394. unpacks it to the screen. You can use this method with the smaller files but 
  395. it tends to corrupt some larger ones. The first method however should work 
  396. with all files. In case you were wondering, the BANK LOAD command allows you 
  397. to load a file from a stacked bank on disk.
  398.  
  399.  
  400. ******************************************************************************
  401.  
  402.  
  403.